#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging.config
import time
logging.config.fileConfig("log/logging.ini")
logger = logging.getLogger("mysql")
log_error = logging.getLogger("error")

class Formatter(logging.Formatter):
    def formatTime(self, record, datefmt=None):
        ct = self.converter(record.created)
        if datefmt:
            try:
                msec = datefmt.split("@")
            except:
                msec= None
            if msec:
                t = time.strftime(datefmt, ct)
                s = "%s,%03d" % (t,record.msecs)
            else:
                s = time.strftime(datefmt, ct)
        else:
            t = time.strftime("%Y-%m-%d %H:%M:%S", ct)
            s = "%s,%03d" % (t, record.msecs)
        return s

if __name__ == '__main__':
    logger.Formatter()
    logger.info("xxxxxxxxxxxxxxxxxxx")
    logger.info("bbbbbbbbbbbb")